package com.whynot.frame.basic.common.model;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel(value = "接口返回对象")
public class APIBase<T> implements Serializable{

    @ApiModelProperty(value = "返回码")
    String code=ErrorCode.SUCCESS_CODE;
    @ApiModelProperty(value = "返回描述")
    String msg="成功";
    @ApiModelProperty(value = "成功与否")
    Boolean success = true;
    @ApiModelProperty(value = "返回的Json数据")
    T data;

    public APIBase() {
    }

    public APIBase(String code, String msg, T data,Boolean success) {
        this.code = code;
        this.msg = msg;
        this.success = success;
        this.data = data;
    }

}
